﻿

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Operacao List</title>
    </head>
    <body>
        <div class="nav">
           
            <span class="menuButton"><g:link class="create" action="create">Nova Operação</g:link></span>
        </div>
        <div class="body">
            <h1>Operações</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
						
                   	        <th>Cliente</th>
							
                   	        <g:sortableColumn property="dataOperacao" title="Data Operacao" />
							
							<th>Número de cheques </th>
							
							<th>Valor total (R$)</th>
                                                        <th>Valor total líquido(R$)</th>
							<th/>
							        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${operacaoList}" status="i" var="operacao">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                                               
                            <td>${operacao.cliente.nome.encodeAsHTML()}</td>
                        
                            <td><g:formatDate format="dd-MM-yyyy" date="${operacao.dataOperacao.time}" /></td>
							
							<td>${operacao.quantidadeCheques.encodeAsHTML()}</td>
							
							<td><g:formatNumber number="${operacao.valorTotal}" format="#,##0.00" />
                                                        <td><g:formatNumber number="${operacao.valorTotalLiquido}" format="#,##0.00" />
							
							<td><g:link action="show" id="${operacao.id}">detalhes</g:link></td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Operacao.count()}" />
            </div>
        </div>
    </body>
</html>
